package com.banyuan.multiple;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * @author 陶继发
 * @version 1.8
 */
@SuppressWarnings("all")
public class Person {
    private static List<Person> list =new ArrayList();
    private Person(){}
    static {
        for (int i = 0; i < 3; i++) {
            Person person = new Person();
            list.add(person);
        }
    }

    public static Person getInstance(){
        Random random = new Random();
        int i = random.nextInt(3);
        return  list.get(i);
    }
}
